PHONY := all
all: camerapicinfo

# Make vendor/etc/camerapicinfo.bin
# ---------------------------------------------------------------------------
PHONY += camerapicinfo

PWD := $(shell pwd)
CONFIG_BIN_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
	  else if [ -x /bin/bash ]; then echo /bin/bash; \
	  fi ; fi)

CAMERAINFO_CFG_NAME := camerapicinfo.cfg
MAKE_CAMERAINFO_SHELL := mkrawinfo.sh
CAMERAINFO_LZ4_TOOL := mtktools

camerapicinfo: FORCE
	@echo "package camerapicinfo.bin !!!@!"; cp -f ../${CAMERAINFO_CFG_NAME} ../$(MAKE_CAMERAINFO_SHELL) $(PWD); cp -rf ../$(CAMERAINFO_LZ4_TOOL) $(PWD); \
	sed -i '/endline/d' $(CAMERAINFO_CFG_NAME); \
	sed -i 's/camerapic\///g' $(CAMERAINFO_CFG_NAME); \
	$(CONFIG_BIN_SHELL) $(MAKE_CAMERAINFO_SHELL) $(CAMERAINFO_CFG_NAME) >/dev/null 2>&1

PHONY += FORCE
FORCE:

.PHONY: $(PHONY)
